1) Field of the Invention
The present invention relates to a technology for measuring a directional (i.e., direction and position) of an object in a three-dimensional space.
2) Description of the Related Art
The directional measuring devices, also called the electronic compasses, detect geomagnetic forces in each of a plurality of directions using a magnetic sensor corresponding to each direction and calculate a direction to be observed, i.e., a directional of an observation axis from the result of detection. Such directional measuring devices are used in cell phones, portable information terminals such as personal digital assistants (PDAs), wrist watches, car navigation systems such as vehicle compasses, attitude detectors for airplanes, directional measuring devices for visually impaired persons, and even game machines.
Particularly, position information service for the portable information terminals has been started recently. In the position information service, a present position of a portable information terminal is displayed on a screen of the portable information terminal along with a map of a surrounding area so that the user of the portable information terminal can locate his/her present position. By thus combining the directional measuring device with the portable information terminal on which the position information service can be enjoyed, it becomes possible for a user to recognize to which direction he/she is facing or to which direction he/she is going. The information providing service that employs the position information service and the directional measuring device is expected to create a lot of new business opportunities in various industrial fields in near future, and the other hand, the users are privileged by getting useful information. However, the spreading of the information providing service requires the precision of the directional measuring device to be increased from what it is at present.
The directional measuring devices have a drawback that an azimuth cannot be precisely measured if the directional measuring devices are in tilted posture. The users of the directional measuring devices may use them or hold them in various ways, and it is quite possible that a user holds his/her directional measuring device in such a manner that a magnetic sensor in the directional measuring device is in a tilted posture. If the magnetic sensor is in a tilted posture, although the observation axes indicate the identical azimuth, an output of the magnetic sensor changes according to an amount of the tilt, and therefore, an error may occur in calculation of the azimuths.
For example, if a biaxial magnetic sensor, which corresponds to an x-axis and a y-axis orthogonal to the x-axis, is rotated around a vertical axis so that the x-axis and the y-axis tilt by a certain tilt angle with respect to the x-y plane, the output of the biaxial magnetic sensor cannot be expressed by simple sine waveform and cosine waveform but can only be expressed with complex waveforms depending on factors such as a dip of the tilt angle. Consequently, an azimuth θ (obtained with θ=arctan (y/x)) calculated from the output of the biaxial magnetic sensor is erroneous.
Japanese Patent Application Laid Open No. 2002-196055 (see page 5, equation 2) discloses an omnidirectional magnetic sensor capable of automatically correcting a tilt and precisely calculating the direction. FIG. 12 is a flowchart of a process procedure disclosed in the above-mentioned literature. As shown in this flowchart, three magnetic vectors corresponding to three dimensions (hereinafter, “three-dimensional magnetic vectors”) are acquired from the output of the magnetic sensor (step S1201). A pitch angle and a roll angle of the body of the magnetic sensor are acquired from the output of a tilt sensor (step S1202). Coordinate transformation is performed twice to the coordinates of the three-dimensional magnetic vectors using the pitch angle and the roll angle to calculate a magnetic vector of a horizontal magnetic field component (step S1203). An azimuth is calculated from the magnetic vector of the horizontal magnetic field component (step S1204).
More specifically, the omnidirectional magnetic sensor employs a method of rotating the geomagnetic vector to the horizontal magnetic field component using the rotational transformation. In the rotational transformation, a product of a rotation matrix used to rotate the body of the omnidirectional magnetic sensor around the X-axis and a rotation matrix used to rotate the body around the Y-axis in an absolute coordinate system is used. The absolute coordinate system includes the X-axis that points towards the magnetic north on a horizontal plane, the Y-axis that is orthogonal to the X-axis on the horizontal plane, and the Z-axis that is orthogonal to the horizontal plane. A observation coordinate system that includes an x-axis that is the direction towards which the body points, a y-axis that is orthogonal to the x-axis, and a z-axis that is orthogonal to the x-axis and the xy plane. The rotational transformation is performed with respect to the absolute coordinate system. In other words, the rotation matrix corresponding to the X-axis is used to rotate the y-axis in the horizontal plane, and the rotation matrix corresponding to the Y-axis is used to rotate the x-axis in the horizontal plane.
Japanese Patent No. 3008813 (see page 10, FIG. 5) discloses a directional measuring device that calculates a true direction by correcting a declination of a magnetic direction. Generally, there is a slight difference between the true north, which is the north on the map, and the magnetic north, which is the direction towards which the needle of a magnetic compass points. Because of the geographical location of Japan, in Japan, the needle of the magnetic compass always points a little westward with respect to the true north. The directional measuring device disclosed employs a method to correct the magnetic direction based on the difference between the direction towards which the needle of the magnetic compass points and the true north.
In the conventional technology, however, when the body is in tilted posture, the azimuth of the body can not be obtained precisely, and, the ambiguity in the calculation of the azimuth increases as the tilt becomes larger. Such problem arises because of the fact that, when there is a tilt, the rotational transformation of the x-axis and the y-axis does not yield proper results. In other words, when there is a tilt, the reverse rotation of the x-axis and the y-axis around the X-axis by the roll angle and the reverse rotation of the x-axis and the y-axis around the Y-axis by the pitch angle do not yield proper result. The reason is that the tilt angles (pitch angle and roll angle), which are angles between the x-axis or the y-axis and the horizontal plane, cannot be used for the rotational transformation as they are.
When the y-axis is reversely rotated the roll angle around the X-axis to make it horizontal, the y-axis is shifted to the horizontal plane, but the x-axis is also shifted following the shift of the y-axis. Consequently, the tilt angle between the x-axis and the horizontal plane does not match the pitch angle, that is, a deviation occurs. Therefore, even if the x-axis is reversely rotated the pitch angle around the Y-axis, the x-axis cannot be shifted to the horizontal plane. The y-axis having already shifted to the horizontal plane also shifts from the horizontal plane through the rotation around the X-axis to cause the y-axis to deviate from the horizontal plane. Thus, in the conventional technology, the geomagnetic vectors are not returned to the horizontal plane depending on the tilt angles, resulting in erroneous calculation of the azimuth including the error accordingly.
On the other hand, it is possible to calculate an azimuth by rotating the tilt angle around the x-axis, the y-axis, and the z-axis forming the observation coordinate system. However, the x-axis, y-axis, and z-axis are difficult to be calculated because the factors involved in the rotational transformation become complex, and the azimuth is difficult to be calculated.